using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_MenuItem_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.MenuItem);
            args = new Type[]{};
            method = type.GetMethod("get_Parent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Parent_0);
            args = new Type[]{typeof(huqiang.UIComposite.MenuItem)};
            method = type.GetMethod("SetParent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetParent_1);

            field = type.GetField("Item", flag);
            app.RegisterCLRFieldGetter(field, get_Item_0);
            app.RegisterCLRFieldSetter(field, set_Item_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Item_0, AssignFromStack_Item_0);
            field = type.GetField("Context", flag);
            app.RegisterCLRFieldGetter(field, get_Context_1);
            app.RegisterCLRFieldSetter(field, set_Context_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Context_1, AssignFromStack_Context_1);
            field = type.GetField("Index", flag);
            app.RegisterCLRFieldGetter(field, get_Index_2);
            app.RegisterCLRFieldSetter(field, set_Index_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Index_2, AssignFromStack_Index_2);
            field = type.GetField("Image", flag);
            app.RegisterCLRFieldGetter(field, get_Image_3);
            app.RegisterCLRFieldSetter(field, set_Image_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Image_3, AssignFromStack_Image_3);
            field = type.GetField("Text", flag);
            app.RegisterCLRFieldGetter(field, get_Text_4);
            app.RegisterCLRFieldSetter(field, set_Text_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_Text_4, AssignFromStack_Text_4);
            field = type.GetField("Expand", flag);
            app.RegisterCLRFieldGetter(field, get_Expand_5);
            app.RegisterCLRFieldSetter(field, set_Expand_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_Expand_5, AssignFromStack_Expand_5);
            field = type.GetField("dir", flag);
            app.RegisterCLRFieldGetter(field, get_dir_6);
            app.RegisterCLRFieldSetter(field, set_dir_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_dir_6, AssignFromStack_dir_6);
            field = type.GetField("Child", flag);
            app.RegisterCLRFieldGetter(field, get_Child_7);
            app.RegisterCLRFieldSetter(field, set_Child_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_Child_7, AssignFromStack_Child_7);
            field = type.GetField("Next", flag);
            app.RegisterCLRFieldGetter(field, get_Next_8);
            app.RegisterCLRFieldSetter(field, set_Next_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_Next_8, AssignFromStack_Next_8);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.MenuItem());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.MenuItem[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_Parent_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.MenuItem instance_of_this_method = (huqiang.UIComposite.MenuItem)typeof(huqiang.UIComposite.MenuItem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Parent;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* SetParent_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.MenuItem @menu = (huqiang.UIComposite.MenuItem)typeof(huqiang.UIComposite.MenuItem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.MenuItem instance_of_this_method = (huqiang.UIComposite.MenuItem)typeof(huqiang.UIComposite.MenuItem).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetParent(@menu);

            return __ret;
        }


        static object get_Item_0(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Item;
        }

        static StackObject* CopyToStack_Item_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Item;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Item_0(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Item = (huqiang.Core.HGUI.UIElement)v;
        }

        static StackObject* AssignFromStack_Item_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @Item = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Item = @Item;
            return ptr_of_this_method;
        }

        static object get_Context_1(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Context;
        }

        static StackObject* CopyToStack_Context_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Context;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Context_1(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Context = (huqiang.UIComposite.MenuContext)v;
        }

        static StackObject* AssignFromStack_Context_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.MenuContext @Context = (huqiang.UIComposite.MenuContext)typeof(huqiang.UIComposite.MenuContext).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Context = @Context;
            return ptr_of_this_method;
        }

        static object get_Index_2(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Index;
        }

        static StackObject* CopyToStack_Index_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Index;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Index_2(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Index = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Index_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Index = ptr_of_this_method->Value;
            ((huqiang.UIComposite.MenuItem)o).Index = @Index;
            return ptr_of_this_method;
        }

        static object get_Image_3(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Image;
        }

        static StackObject* CopyToStack_Image_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Image;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Image_3(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Image = (huqiang.UIEvent.UserEvent)v;
        }

        static StackObject* AssignFromStack_Image_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIEvent.UserEvent @Image = (huqiang.UIEvent.UserEvent)typeof(huqiang.UIEvent.UserEvent).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Image = @Image;
            return ptr_of_this_method;
        }

        static object get_Text_4(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Text;
        }

        static StackObject* CopyToStack_Text_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Text;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Text_4(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Text = (huqiang.Core.HGUI.HText)v;
        }

        static StackObject* AssignFromStack_Text_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.HText @Text = (huqiang.Core.HGUI.HText)typeof(huqiang.Core.HGUI.HText).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Text = @Text;
            return ptr_of_this_method;
        }

        static object get_Expand_5(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Expand;
        }

        static StackObject* CopyToStack_Expand_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Expand;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Expand_5(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Expand = (huqiang.Core.HGUI.UIElement)v;
        }

        static StackObject* AssignFromStack_Expand_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @Expand = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Expand = @Expand;
            return ptr_of_this_method;
        }

        static object get_dir_6(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).dir;
        }

        static StackObject* CopyToStack_dir_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).dir;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_dir_6(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).dir = (System.Int32)v;
        }

        static StackObject* AssignFromStack_dir_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @dir = ptr_of_this_method->Value;
            ((huqiang.UIComposite.MenuItem)o).dir = @dir;
            return ptr_of_this_method;
        }

        static object get_Child_7(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Child;
        }

        static StackObject* CopyToStack_Child_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Child;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Child_7(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Child = (System.Collections.Generic.List<huqiang.UIComposite.MenuItem>)v;
        }

        static StackObject* AssignFromStack_Child_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Collections.Generic.List<huqiang.UIComposite.MenuItem> @Child = (System.Collections.Generic.List<huqiang.UIComposite.MenuItem>)typeof(System.Collections.Generic.List<huqiang.UIComposite.MenuItem>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Child = @Child;
            return ptr_of_this_method;
        }

        static object get_Next_8(ref object o)
        {
            return ((huqiang.UIComposite.MenuItem)o).Next;
        }

        static StackObject* CopyToStack_Next_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.MenuItem)o).Next;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Next_8(ref object o, object v)
        {
            ((huqiang.UIComposite.MenuItem)o).Next = (huqiang.Core.HGUI.UIElement)v;
        }

        static StackObject* AssignFromStack_Next_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @Next = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.MenuItem)o).Next = @Next;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.MenuItem();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
